<html>
<head><meta charset="utf-8"><title>cargo patch crates with different names · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/cargo.20patch.20crates.20with.20different.20names.html">cargo patch crates with different names</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="244536901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/cargo%20patch%20crates%20with%20different%20names/near/244536901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashutosh Varma <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/cargo.20patch.20crates.20with.20different.20names.html#244536901">(Jul 01 2021 at 09:02)</a>:</h4>
<div class="codehilite" data-code-language="TOML"><pre><span></span><code><span class="k">[patch.crates-io]</span>
<span class="s">'crate1'</span> <span class="o">=</span> <span class="p">{</span> <span class="n">package</span><span class="o">=</span><span class="s">"crate1-patched"</span><span class="p">,</span> <span class="n">version</span><span class="o">=</span><span class="s">"0.1.0"</span> <span class="p">}</span>
</code></pre></div>
<p>Why is it not possible?</p>
<p>Since we have dependency renaming, I thought this would be also possible.</p>



<a name="244580775"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/cargo%20patch%20crates%20with%20different%20names/near/244580775" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/cargo.20patch.20crates.20with.20different.20names.html#244580775">(Jul 01 2021 at 15:03)</a>:</h4>
<p>The ban pre dates dependency renaming. I don't know if it still makes sence. There is an issue on Cargo's repo about it.</p>



<a name="244669812"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/cargo%20patch%20crates%20with%20different%20names/near/244669812" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashutosh Varma <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/cargo.20patch.20crates.20with.20different.20names.html#244669812">(Jul 02 2021 at 07:48)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120179">Eh2406</span> <a href="#narrow/stream/122651-general/topic/cargo.20patch.20crates.20with.20different.20names/near/244580775">said</a>:</p>
<blockquote>
<p>The ban pre dates dependency renaming. I don't know if it still makes sence. There is an issue on Cargo's repo about it.</p>
</blockquote>
<p>I couldn't find such an issue on cargo Github, do you mind sharing the link here</p>



<a name="244708246"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/cargo%20patch%20crates%20with%20different%20names/near/244708246" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/cargo.20patch.20crates.20with.20different.20names.html#244708246">(Jul 02 2021 at 14:14)</a>:</h4>
<p>It can be really hard to find thins in our Issues, but I got lucky this time!<br>
<a href="https://github.com/rust-lang/cargo/issues/9227">https://github.com/rust-lang/cargo/issues/9227</a></p>



<a name="244914766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/cargo%20patch%20crates%20with%20different%20names/near/244914766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ashutosh Varma <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/cargo.20patch.20crates.20with.20different.20names.html#244914766">(Jul 05 2021 at 09:43)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120179">Eh2406</span> <a href="#narrow/stream/122651-general/topic/cargo.20patch.20crates.20with.20different.20names/near/244708246">said</a>:</p>
<blockquote>
<p>It can be really hard to find thins in our Issues, but I got lucky this time!<br>
<a href="https://github.com/rust-lang/cargo/issues/9227">https://github.com/rust-lang/cargo/issues/9227</a></p>
</blockquote>
<p>Thanks for taking out time to find this :)<br>
I will try to make a PR to support this assumimg I'm able to make it work somehow.<br>
I'm not familiar with cargo repo but looks like I have to start from here - <a href="https://github.com/rust-lang/cargo/blob/3ebb5f15a940810f250b68821149387af583a79e/src/cargo/ops/resolve.rs#L207">https://github.com/rust-lang/cargo/blob/3ebb5f15a940810f250b68821149387af583a79e/src/cargo/ops/resolve.rs#L207</a></p>



<a name="245058433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/cargo%20patch%20crates%20with%20different%20names/near/245058433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eh2406 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/cargo.20patch.20crates.20with.20different.20names.html#245058433">(Jul 06 2021 at 15:50)</a>:</h4>
<p>The team has not had time to decide if this is something we "want" to have happen. So comment on the Issue before putting a lot of time into implementation.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>